package com.stellar.gateway.service;

import com.stellar.core.util.JwtUtil;
import io.jsonwebtoken.Claims;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class JwtService {

    public Claims validateToken(String token, String secretKey) {
        try {
            return JwtUtil.parseJWT(secretKey, token);
        } catch (Exception e) {
            log.error("JWT 校验失败: {}", e.getMessage());
            return null;
        }
    }
}